<!DOCTYPE html>
<html>
<#include "../head.html">
    <body class="full">
    <div class="mc">
        <div class="mc-l">
            <!--左侧导航---{-->
            <div id="navPanelContainer">
                <div class="system-logo cd"></div>
                <!--管理员信息---{-->
                <#include "../adminInfo.html">
                    <!--管理员信息---}-->
                    <div class="nav-wrap">
                        <#include "left.html">
                    </div>
            </div>
            <!--左侧导航---}-->
        </div>
        <div class="mc-m">
            <div class="navToggle"></div>
        </div>
        <div class="mc-r">
            <!--顶部导航---{-->
            <#include "../topNav.html">
                <!--顶部导航---}-->

                <!--面包屑导航---{-->
                <#assign moduleName="修改文章">
                    <#include "banner.html">
                        <!--面包屑导航---}-->

                        <!--工具栏--{-->
                        <div id="toolbar" class="clearfix">
                            <div class="toolbor-module">
                                <a class="input-button" href="#" onclick="location.href='showArticle.html'">返回</a>
                                <!--  <a class="input-button" href="addSite.html" style="line-height:24px;">添加子栏目</a> -->
                            </div>
                        </div>
                        <!--工具栏--}-->

                        <div id="main" class="w750 clearfix">

                            <form name="form1" method="post" action="" onsubmit="return check_form();" enctype="multipart/form-data" >
                                <div class="valBox">
                                    <div class="top">
                                        <strong>修改文章</strong>
                                    </div>
                                    <div class="clearfix">
                                        <ul class="title-v edit">
                                            <li>
                                                <div class="title">标题：</div>
                                                <div class="v">
                                                    <input type="text" name="name"  class="input_border" value="${a.name!}" size="30" />
                                                    <label>
                                                        <input type="checkbox" onclick="jump_url()"
                                                               name="isJump" value="1" <#if a??&&a.isJump??&&a.isJump=='1'>checked="checked"</#if>/> 跳转</label>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">栏目英文标识：</div>
                                                <div class="v">
                                                    <input type="text" name="ename"  class="input_border" value="${a.ename!}" size="30" disabled="disabled"/>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">定义属性：</div>
                                                <div class="v">
                                                    <label><input type="checkbox" name="flag" value="t" <#if a.flag?? && a.flag?contains("t")>checked="checked"</#if>/> 推荐</label>
                                                    <label><input type="checkbox" name="flag" value="h" <#if a.flag?? && a.flag?contains("h")>checked="checked"</#if>/> 头条</label>
                                                    <#--  <label><input type='checkbox' name='flag' value='f' <#if a.flag!?contains("f")>checked</#if>>幻灯片</label>-->
                                                </div>
                                            </li>
                                            <li style="display:none" id="jump_url">
                                                <div class="title">跳转网址：</div>
                                                <div class="v">
                                                    <input type="text" name="jumpurl"  class="input_border" value="${a.jumpurl!}" size="30" />
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">所属栏目：</div>
                                                <div class="v">
                                                    <!--<@siteDirect name="site_id" default=a.site.siteId></@siteDirect>  -->
                                                    <span>${a.site.name!}<input type="hidden" name="siteId" value="${a.site.siteId}"></span>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">文章来源：</div>
                                                <div class="v">
                                                    <input type="text" name="source"  class="input_border" value="${a.source!}" size="30" />
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">作者：</div>
                                                <div class="v">
                                                    <input type="text" name="author"  class="input_border" value="${a.author!}" size="30" />
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">发布时间：</div>
                                                <div class="v">
                                                    <input type="text" name="publish"  class="input_border" value="${a.publish!}" size="30" onclick="change_picktime('yyyy-MM-dd HH:mm:ss')" readonly=""/>                                            </div>
                                            </li>
                                            <li>
                                                <div class="title">状态：</div>
                                                <div class="v">
                                                    <label><input type="radio" name="status" value="0"  <#if a??&&a.status==0>checked="checked"</#if>/>隐藏</label>
                                                    <label><input type="radio" name="status" value="1"  <#if a??&&a.status==1>checked="checked"</#if>/>显示</label>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">排序：</div>
                                                <div class="v">
                                                    <input type="text" name="order"  class="input_border" value="${a.order!0}" size="10" />
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">内容简介：</div>
                                                <div class="v">
                                                    <textarea name="summary" cols="45" rows="5">${a.summary!}</textarea>
                                                </div>
                                            </li>
                                            <script charset="utf-8" src="${request.getContextPath()}/plugins/editor/kindeditor/kindeditor-min.js"></script>
                                            <script charset="utf-8" src="${request.getContextPath()}/plugins/editor/kindeditor/lang/zh_CN.js"></script>
                                            <li>
                                                <div class="title">内容：</div>
                                                <div class="v">
                                                    <#if a.content??>
                                                        <#include "../../common/ueditor.html">
                                                            <@showUeditor width=680 heigth=100 id="content" name="content" content="${a.content!} " />
                                                            <#else>
                                                                <@showUeditor width=680 heigth=100 id="content" name="content" content=" " />
                                                    </#if>
                                                </div>
                                            </li>
                                            <#if files??>
                                                <#list files as item>
                                                    <li>
                                                        <div class="title">附件${item_index+1}：</div>
                                                        <div class="v">
                                                            ${item.files}
                                                        </div>
                                                    </li>
                                                </#list>
                                            </#if>

                                            <li>
                                                <div class="title">上传文件：</div>
                                                <div class="v">
                                                    <input type='file' name='files' value='${item.litpic!''}size='20' id='files'>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>

                                </div>

                                <div id="bottomToolbar" class="clearfix">
                                    <input type="hidden"  name="actionType" value="modifyArticle" />
                                    <input class="input-button post" type="submit"  name="submit" value="提交" />
                                    <input class="input-button post" type="reset"  name="reset" value="重置" />
                                </div>
                            </form>
                        </div>
                        <script>
                            KindEditor.ready(function(K) {
                                editor = K.create('textarea[name="content"]', {
                                    uploadJson : '${webroot}/editorUploadImg.html',
                                    fileManagerJson : '${webroot}/editorUploadImg.html',
                                    allowFileManager : true,
                                    items:['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
                                        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                                        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                                        'superscript', '|', 'selectall', '-',
                                        'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
                                        'italic', 'underline', 'strikethrough', 'removeformat', '|',
                                        'image','advtable', 'hr', 'emoticons', 'link', 'unlink']
                                });
                            });
                            function check_form(){
                                var frm = document.forms['form1'];
                                var name = frm.elements['name'].value;
                                var content = frm.elements['content'].value;
                                var errorMsg = '';
                                if (name.length == 0 ) {
                                    errorMsg += '标题必须填写' + '\n';
                                }

                                if (errorMsg.length > 0){
                                    alert(errorMsg); return false;
                                } else{
                                    return true;
                                }
                            }

                            function jump_url(){
                                if (document.getElementById('jump_url').style.display == ""){
                                    document.getElementById('jump_url').style.display = "none";
                                    document.getElementById('jump_id').style.display = "";
                                }else{
                                    document.getElementById('jump_url').style.display = "";
                                    document.getElementById('jump_id').style.display = "none";
                                }
                            }
                        </script>
        </div>
    </div>
    <div class="mc-b">
        <#include "../foot.html">
    </div>
    <#include "../../jsPage.html">
   <div class="msgClass">
       ${rsmsg!""}
   </div>
    </body>
</html>
